package com.cxm.helper.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: chenximeng
 * @date: 2022/11/21 15:59
 */
@Getter
@AllArgsConstructor
public enum UserRoleEnum {
    USER(0, "普通用户"),

    ADMIN(1, "管理员");

    private int code;

    private String name;

    public static Integer reversCode(Integer code) {
        return code.equals(UserRoleEnum.USER.getCode()) ? UserRoleEnum.ADMIN.getCode():UserRoleEnum.USER.getCode();
    }
}
